<template>
  <div>
    <!-- 标题 -->
    <h4 class="text-center">用户管理</h4>

    <!-- 用户列表 -->
    <table class="table table-bordered table-striped table-hover">
      <thead>
        <tr>
          <th>#</th>
          <th>姓名</th>
          <th>年龄</th>
          <th>头衔</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, index) in userlist" :key="item.id">
          <td> {{ index + 1 }} </td>
          <td> {{ item.name }} </td>
          <td> {{ item.age }} </td>
          <td> {{ item.position }}</td>
          <td>
              <router-link :to="'/home/detail/' + item.id">查看详情</router-link>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  name: 'MyUser',
  data () {
    return {
      // 用户列表数据
      userlist: [
        { id: 1, name: '小新', age: 6, position: '野原新之助' },
        { id: 2, name: '妮妮', age: 7, position: '樱田妮妮' },
        { id: 3, name: '风间', age: 8, position: '风间彻' },
        { id: 4, name: '正男', age: 9, position: '佐藤正男' },
        { id: 5, name: '阿呆', age: 10, position: '井川棒太郎' }
      ]
    }
  }
}
</script>

<style lang="less" scoped></style>
